﻿Class ProcessItemStatusView

    Private processItem As ProcessItem
    Private parentPanel As CompanyPanel
    Private position As Point
    Sub New(ByVal aProcessItem As ProcessItem, ByVal companyPanel As CompanyPanel, ByVal aPosition As Point)
        processItem = aProcessItem
        parentPanel = companyPanel
        position = aPosition
        createFinalizedItemCheckbox()
        createItemNameLabel()
        createPending()
    End Sub

    Private Sub createFinalizedItemCheckbox()
        Dim checkBox As CheckBox = New CheckBox()
        checkBox.Checked = False
        checkBox.Size = New Size(20, 20)
        checkBox.Enabled = False
        checkBox.Location = New Point(position.X, position.Y - 3)
        parentPanel.Controls.Add(checkBox)
        Dim checkBoxObserver As CheckBoxObserver = New CheckBoxObserver(checkBox, processItem)
    End Sub

    Private Sub createItemNameLabel()
        Dim label = New Label()
        label.Text = processItem.getName()
        label.Size = New Size(100, 20)
        label.Location = New Point(position.X + 20, position.Y)
        parentPanel.Controls.Add(label)
    End Sub

    Private Sub createPending()
        Dim label = New Label()
        label.Size = New Size(50, 20)
        label.Location = New Point(position.X + 120, position.Y)
        parentPanel.Controls.Add(label)
        Dim progressObserver As ProcessItemProgressObserver = New ProcessItemProgressObserver(label, processItem)
    End Sub

End Class
